﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LLFM.CAT.Service;
using LLFM.CAT.Model;

public partial class Index : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        navuc.CurrentTagLevelOne = 1;
        InitData();
    }

    private void InitData() 
    {
        List<M_FocusImages> focusImagesList = FocusImagesService.GetFocusImagesList(1);
        rptFocusImageList.DataSource =focusImagesList;
        rptFocusImageList.DataBind();
        rptFocusImageCountList.DataSource = focusImagesList;
        rptFocusImageCountList.DataBind();
    }

    protected void FocusImageCountListDataBound(object sender, RepeaterItemEventArgs e) 
    {
        if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Literal ltlText = (Literal)e.Item.FindControl("ltlText");
            ltlText.Text = (e.Item.ItemIndex + 1).ToString();
        }
    }
}